using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VVAEA
    {
        public DataRow Convert2VAEA(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryVAEA(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["VAEMANDANT"] = " ".PadRight(2 ); 
         dwReturn["VAEAUFTYP"] = " ".PadRight(1 ); 
         dwReturn["VAEAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["VAEAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["VAEAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["VAEAENDST"] = " ".PadRight(0 ); 
         dwReturn["VAEAUFART"] = " ".PadRight(2 ); 
         dwReturn["VAEAEDAT"] = " ".PadRight(0 ); 
         dwReturn["VAEERSTAKZ"] = " ".PadRight(1 ); 
         dwReturn["VAEORDER"] = " ".PadRight(4 ); 
         dwReturn["VAEPRGRP"] = " ".PadRight(8 ); 
         dwReturn["VAEPROJNR"] = " ".PadRight(5 ); 
         dwReturn["VAEVKZ"] = " ".PadRight(1 ); 
         dwReturn["VAEAENDDAT"] = " ".PadRight(0 ); 
         dwReturn["VAEPOSTYP"] = " ".PadRight(3 ); 
         dwReturn["VAEVB"] = " ".PadRight(3 ); 
         dwReturn["VAEVG"] = " ".PadRight(3 ); 
         dwReturn["VAEVERTNR1"] = " ".PadRight(8 ); 
         dwReturn["VAEVERTNR2"] = " ".PadRight(8 ); 
         dwReturn["VAEVERTNR3"] = " ".PadRight(8 ); 
         dwReturn["VAEVERTNR4"] = " ".PadRight(8 ); 
         dwReturn["VAELAND"] = " ".PadRight(3 ); 
         dwReturn["VAEKZINLEXP"] = " ".PadRight(1 ); 
         dwReturn["VAEPLZ"] = " ".PadRight(12 ); 
         dwReturn["VAEGEBIET"] = " ".PadRight(3 ); 
         dwReturn["VAEKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["VAEVERBNR"] = " ".PadRight(8 ); 
         dwReturn["VAEZENTRR"] = " ".PadRight(1 ); 
         dwReturn["VAEZENTR"] = " ".PadRight(8 ); 
         dwReturn["VAEABNGRP"] = " ".PadRight(3 ); 
         dwReturn["VAEBRANCHE"] = " ".PadRight(3 ); 
         dwReturn["VAEABCKL"] = " ".PadRight(1 ); 
         dwReturn["VAEKUNDNRST"] = " ".PadRight(8 ); 
         dwReturn["VAEABNGRPST"] = " ".PadRight(3 ); 
         dwReturn["VAEBUSIMODE"] = " ".PadRight(3 ); 
         dwReturn["VAEPRDGR"] = " ".PadRight(3 ); 
         dwReturn["VAEARTGRP"] = " ".PadRight(3 ); 
         dwReturn["VAEZIELGR"] = " ".PadRight(4 ); 
         dwReturn["VAEPVGRP"] = " ".PadRight(3 ); 
         dwReturn["VAEOBERKOLL"] = " ".PadRight(5 ); 
         dwReturn["VAEKOLL"] = " ".PadRight(5 ); 
         dwReturn["VAEVART"] = " ".PadRight(24 ); 
         dwReturn["VAEVFARBE"] = " ".PadRight(10 ); 
         dwReturn["VAEVZENSUR"] = " ".PadRight(1 ); 
         dwReturn["VAEVAUFMART"] = " ".PadRight(2 ); 
         dwReturn["VAEVVERPART"] = " ".PadRight(3 ); 
         dwReturn["VAEVGROE"] = " ".PadRight(7 ); 
         dwReturn["VAEVZOLLTNR"] = " ".PadRight(20 ); 
         dwReturn["VAESTATWNR"] = " ".PadRight(12 ); 
         dwReturn["VAEDKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["VAEDWERK"] = " ".PadRight(3 ); 
         dwReturn["VAEDABT"] = " ".PadRight(3 ); 
         dwReturn["VAEDART"] = " ".PadRight(20 ); 
         dwReturn["VAEDVAR"] = " ".PadRight(3 ); 
         dwReturn["VAEZUSAETZE"] = " ".PadRight(40 ); 
         dwReturn["VAEPHK1"] = " ".PadRight(0 ); 
         dwReturn["VAEPHK2"] = " ".PadRight(0 ); 
         dwReturn["VAEPHK3"] = " ".PadRight(0 ); 
         dwReturn["VAEPHK4"] = " ".PadRight(0 ); 
         dwReturn["VAEPHK5"] = " ".PadRight(0 ); 
         dwReturn["VAEPHK6"] = " ".PadRight(0 ); 
         dwReturn["VAEPLART"] = " ".PadRight(20 ); 
         dwReturn["VAERFDDIS"] = " ".PadRight(0 ); 
         dwReturn["VAEUMSATZAUFTR"] = " ".PadRight(0 ); 
         dwReturn["VAEMENGE1"] = " ".PadRight(0 ); 
         dwReturn["VAEMENGE2"] = " ".PadRight(0 ); 
         dwReturn["VAEMENGE3"] = " ".PadRight(0 ); 
         dwReturn["VAEMENGE4"] = " ".PadRight(0 ); 
         dwReturn["VAEZUGET1"] = " ".PadRight(0 ); 
         dwReturn["VAEZUGET2"] = " ".PadRight(0 ); 
         dwReturn["VAEZUGET3"] = " ".PadRight(0 ); 
         dwReturn["VAEZUGET4"] = " ".PadRight(0 ); 
         dwReturn["VAERESERV1"] = " ".PadRight(0 ); 
         dwReturn["VAERESERV2"] = " ".PadRight(0 ); 
         dwReturn["VAERESERV3"] = " ".PadRight(0 ); 
         dwReturn["VAERESERV4"] = " ".PadRight(0 ); 
         dwReturn["VAERABWERT"] = " ".PadRight(0 ); 
         dwReturn["VAEZUABWERT"] = " ".PadRight(0 ); 
         dwReturn["VAETRANSCO"] = " ".PadRight(0 ); 
         dwReturn["VAEMWST"] = " ".PadRight(0 ); 
         dwReturn["VAEWAEHRSL"] = " ".PadRight(3 ); 
         dwReturn["VAEKURS"] = " ".PadRight(0 ); 
         dwReturn["VAEBETRAG"] = " ".PadRight(0 ); 
         dwReturn["VAEHWAEHRSL"] = " ".PadRight(3 ); 
         dwReturn["VAEHEUROKURS"] = " ".PadRight(0 ); 
         dwReturn["VAEHEUROKURSVK"] = " ".PadRight(1 ); 
         dwReturn["VAEFEUROKURS"] = " ".PadRight(0 ); 
         dwReturn["VAEFEUROKURSVK"] = " ".PadRight(1 ); 
         dwReturn["VAEAUFTRMENGE"] = " ".PadRight(0 ); 
         dwReturn["VAEMEEH"] = " ".PadRight(3 ); 
         dwReturn["VAEMEEHGRP"] = " ".PadRight(1 ); 
         dwReturn["VAEMEEHFKT"] = " ".PadRight(12 ); 
         dwReturn["VAEUMSATZPRL"] = " ".PadRight(0 ); 
         dwReturn["VAESACHB"] = " ".PadRight(8 ); 
         dwReturn["VAEDSACHB"] = " ".PadRight(8 ); 
         dwReturn["VAEKOAUFKRS"] = " ".PadRight(2 ); 
         dwReturn["VAEKOAUFLFD"] = " ".PadRight(6 ); 
         dwReturn["VAEKOAUFPOS"] = " ".PadRight(3 ); 
         dwReturn["VAEKOAUFART"] = " ".PadRight(2 ); 
         dwReturn["VAEKOAUFKRS1"] = " ".PadRight(2 ); 
         dwReturn["VAEKOAUFLFD1"] = " ".PadRight(6 ); 
         dwReturn["VAEKOAUFPOS1"] = " ".PadRight(3 ); 
         dwReturn["VAEKOAUFART1"] = " ".PadRight(2 ); 
         dwReturn["VAEKUNDNRKO"] = " ".PadRight(8 ); 
         dwReturn["VAECOUPON"] = " ".PadRight(1 ); 
         dwReturn["VAEPART"] = " ".PadRight(20 ); 
         dwReturn["VAEPRODST"] = " ".PadRight(1 ); 
         dwReturn["VAEARTST"] = " ".PadRight(1 ); 
         dwReturn["VAEPVAR"] = " ".PadRight(3 ); 
         dwReturn["VAELIEFEING"] = " ".PadRight(8 ); 
         dwReturn["VAELITERM"] = " ".PadRight(0 ); 
         dwReturn["VAENEUDAT"] = " ".PadRight(0 ); 
         dwReturn["VAEMWSTAB"] = " ".PadRight(0 ); 
         dwReturn["VAEZUSTAND"] = " ".PadRight(4 ); 
         dwReturn["VAEPRMTR"] = " ".PadRight(0 ); 
         dwReturn["VAEKKOLL"] = " ".PadRight(5 ); 
         dwReturn["VAEMKOLL"] = " ".PadRight(5 ); 
         dwReturn["VAENOCOUNT"] = " ".PadRight(1 ); 
         dwReturn["VAEFARBGRP"] = " ".PadRight(1 ); 
         dwReturn["VAEVMVB"] = " ".PadRight(3 ); 
         dwReturn["VAEVMVG"] = " ".PadRight(3 ); 
         dwReturn["VAEKEYAC"] = " ".PadRight(8 ); 
         dwReturn["VAESTLAND"] = " ".PadRight(2 ); 
         dwReturn["VAESTREGBZ"] = " ".PadRight(2 ); 
         dwReturn["VAESTKREIS"] = " ".PadRight(2 ); 
         dwReturn["VAESTORT"] = " ".PadRight(3 ); 
         dwReturn["VAECOUNTY"] = " ".PadRight(4 ); 
         dwReturn["VAEKONZMIT"] = " ".PadRight(1 ); 
         dwReturn["VAEABSSCHL"] = " ".PadRight(3 ); 
         dwReturn["VAEDISTRWEG"] = " ".PadRight(3 ); 
         dwReturn["VAEWERBSL1"] = " ".PadRight(3 ); 
         dwReturn["VAEWERBSL2"] = " ".PadRight(3 ); 
         dwReturn["VAEWERBSL3"] = " ".PadRight(3 ); 
         dwReturn["VAEWERBSL4"] = " ".PadRight(3 ); 
         dwReturn["VAEWERBSL5"] = " ".PadRight(3 ); 
         dwReturn["VAEKOLLSEG1"] = " ".PadRight(3 ); 
         dwReturn["VAEKOLLSEG2"] = " ".PadRight(3 ); 
         dwReturn["VAEKOLLSEG3"] = " ".PadRight(3 ); 
         dwReturn["VAEKOLLSEG4"] = " ".PadRight(3 ); 
         dwReturn["VAEKOLLSEG5"] = " ".PadRight(3 ); 
         dwReturn["VAEFEATURE1"] = " ".PadRight(4 ); 
         dwReturn["VAEFEATURE2"] = " ".PadRight(4 ); 
         dwReturn["VAEFEATURE3"] = " ".PadRight(4 ); 
         dwReturn["VAEFEATURE4"] = " ".PadRight(4 ); 
         dwReturn["VAEFEATURE5"] = " ".PadRight(4 ); 
         dwReturn["VAEEINSATZG"] = " ".PadRight(4 ); 
         dwReturn["VAEVERWEND"] = " ".PadRight(4 ); 
         dwReturn["VAEABZKZ"] = " ".PadRight(1 ); 
         dwReturn["VAEERLKZ"] = " ".PadRight(1 ); 
         dwReturn["VAESGRD"] = " ".PadRight(2 ); 
         dwReturn["VAEVTYP"] = " ".PadRight(1 ); 
         dwReturn["VAEFILLER2"] = " ".PadRight(97 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapVAEA(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveVAEA(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryVAEA(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapVAEA(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertVAEA(dwLocal, ITXDBVERSION);
            }
            UpdateVAEA(dwLocal);
        }
        public void InsertVAEA(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO VAEA(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryVAEA(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM VAEA WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM VAEA  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VAEA";
            Return = Result;
            return Return;
        }
        public void DeleteVAEA(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM VAEA   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateVAEA(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE VAEA SET "
                    +"VAEMANDANT= :VAEMANDANT,"
                    +"VAEAUFTYP= :VAEAUFTYP,"
                    +"VAEAUFKRS= :VAEAUFKRS,"
                    +"VAEAUFLFD= :VAEAUFLFD,"
                    +"VAEAUFPOS= :VAEAUFPOS,"
                    +"VAEAENDST= :VAEAENDST,"
                    +"VAEAUFART= :VAEAUFART,"
                    +"VAEAEDAT= :VAEAEDAT,"
                    +"VAEERSTAKZ= :VAEERSTAKZ,"
                    +"VAEORDER= :VAEORDER,"
                    +"VAEPRGRP= :VAEPRGRP,"
                    +"VAEPROJNR= :VAEPROJNR,"
                    +"VAEVKZ= :VAEVKZ,"
                    +"VAEAENDDAT= :VAEAENDDAT,"
                    +"VAEPOSTYP= :VAEPOSTYP,"
                    +"VAEVB= :VAEVB,"
                    +"VAEVG= :VAEVG,"
                    +"VAEVERTNR1= :VAEVERTNR1,"
                    +"VAEVERTNR2= :VAEVERTNR2,"
                    +"VAEVERTNR3= :VAEVERTNR3,"
                    +"VAEVERTNR4= :VAEVERTNR4,"
                    +"VAELAND= :VAELAND,"
                    +"VAEKZINLEXP= :VAEKZINLEXP,"
                    +"VAEPLZ= :VAEPLZ,"
                    +"VAEGEBIET= :VAEGEBIET,"
                    +"VAEKUNDNR= :VAEKUNDNR,"
                    +"VAEVERBNR= :VAEVERBNR,"
                    +"VAEZENTRR= :VAEZENTRR,"
                    +"VAEZENTR= :VAEZENTR,"
                    +"VAEABNGRP= :VAEABNGRP,"
                    +"VAEBRANCHE= :VAEBRANCHE,"
                    +"VAEABCKL= :VAEABCKL,"
                    +"VAEKUNDNRST= :VAEKUNDNRST,"
                    +"VAEABNGRPST= :VAEABNGRPST,"
                    +"VAEBUSIMODE= :VAEBUSIMODE,"
                    +"VAEPRDGR= :VAEPRDGR,"
                    +"VAEARTGRP= :VAEARTGRP,"
                    +"VAEZIELGR= :VAEZIELGR,"
                    +"VAEPVGRP= :VAEPVGRP,"
                    +"VAEOBERKOLL= :VAEOBERKOLL,"
                    +"VAEKOLL= :VAEKOLL,"
                    +"VAEVART= :VAEVART,"
                    +"VAEVFARBE= :VAEVFARBE,"
                    +"VAEVZENSUR= :VAEVZENSUR,"
                    +"VAEVAUFMART= :VAEVAUFMART,"
                    +"VAEVVERPART= :VAEVVERPART,"
                    +"VAEVGROE= :VAEVGROE,"
                    +"VAEVZOLLTNR= :VAEVZOLLTNR,"
                    +"VAESTATWNR= :VAESTATWNR,"
                    +"VAEDKUNDNR= :VAEDKUNDNR,"
                    +"VAEDWERK= :VAEDWERK,"
                    +"VAEDABT= :VAEDABT,"
                    +"VAEDART= :VAEDART,"
                    +"VAEDVAR= :VAEDVAR,"
                    +"VAEZUSAETZE= :VAEZUSAETZE,"
                    +"VAEPHK1= :VAEPHK1,"
                    +"VAEPHK2= :VAEPHK2,"
                    +"VAEPHK3= :VAEPHK3,"
                    +"VAEPHK4= :VAEPHK4,"
                    +"VAEPHK5= :VAEPHK5,"
                    +"VAEPHK6= :VAEPHK6,"
                    +"VAEPLART= :VAEPLART,"
                    +"VAERFDDIS= :VAERFDDIS,"
                    +"VAEUMSATZAUFTR= :VAEUMSATZAUFTR,"
                    +"VAEMENGE1= :VAEMENGE1,"
                    +"VAEMENGE2= :VAEMENGE2,"
                    +"VAEMENGE3= :VAEMENGE3,"
                    +"VAEMENGE4= :VAEMENGE4,"
                    +"VAEZUGET1= :VAEZUGET1,"
                    +"VAEZUGET2= :VAEZUGET2,"
                    +"VAEZUGET3= :VAEZUGET3,"
                    +"VAEZUGET4= :VAEZUGET4,"
                    +"VAERESERV1= :VAERESERV1,"
                    +"VAERESERV2= :VAERESERV2,"
                    +"VAERESERV3= :VAERESERV3,"
                    +"VAERESERV4= :VAERESERV4,"
                    +"VAERABWERT= :VAERABWERT,"
                    +"VAEZUABWERT= :VAEZUABWERT,"
                    +"VAETRANSCO= :VAETRANSCO,"
                    +"VAEMWST= :VAEMWST,"
                    +"VAEWAEHRSL= :VAEWAEHRSL,"
                    +"VAEKURS= :VAEKURS,"
                    +"VAEBETRAG= :VAEBETRAG,"
                    +"VAEHWAEHRSL= :VAEHWAEHRSL,"
                    +"VAEHEUROKURS= :VAEHEUROKURS,"
                    +"VAEHEUROKURSVK= :VAEHEUROKURSVK,"
                    +"VAEFEUROKURS= :VAEFEUROKURS,"
                    +"VAEFEUROKURSVK= :VAEFEUROKURSVK,"
                    +"VAEAUFTRMENGE= :VAEAUFTRMENGE,"
                    +"VAEMEEH= :VAEMEEH,"
                    +"VAEMEEHGRP= :VAEMEEHGRP,"
                    +"VAEMEEHFKT= :VAEMEEHFKT,"
                    +"VAEUMSATZPRL= :VAEUMSATZPRL,"
                    +"VAESACHB= :VAESACHB,"
                    +"VAEDSACHB= :VAEDSACHB,"
                    +"VAEKOAUFKRS= :VAEKOAUFKRS,"
                    +"VAEKOAUFLFD= :VAEKOAUFLFD,"
                    +"VAEKOAUFPOS= :VAEKOAUFPOS,"
                    +"VAEKOAUFART= :VAEKOAUFART,"
                    +"VAEKOAUFKRS1= :VAEKOAUFKRS1,"
                    +"VAEKOAUFLFD1= :VAEKOAUFLFD1,"
                    +"VAEKOAUFPOS1= :VAEKOAUFPOS1,"
                    +"VAEKOAUFART1= :VAEKOAUFART1,"
                    +"VAEKUNDNRKO= :VAEKUNDNRKO,"
                    +"VAECOUPON= :VAECOUPON,"
                    +"VAEPART= :VAEPART,"
                    +"VAEPRODST= :VAEPRODST,"
                    +"VAEARTST= :VAEARTST,"
                    +"VAEPVAR= :VAEPVAR,"
                    +"VAELIEFEING= :VAELIEFEING,"
                    +"VAELITERM= :VAELITERM,"
                    +"VAENEUDAT= :VAENEUDAT,"
                    +"VAEMWSTAB= :VAEMWSTAB,"
                    +"VAEZUSTAND= :VAEZUSTAND,"
                    +"VAEPRMTR= :VAEPRMTR,"
                    +"VAEKKOLL= :VAEKKOLL,"
                    +"VAEMKOLL= :VAEMKOLL,"
                    +"VAENOCOUNT= :VAENOCOUNT,"
                    +"VAEFARBGRP= :VAEFARBGRP,"
                    +"VAEVMVB= :VAEVMVB,"
                    +"VAEVMVG= :VAEVMVG,"
                    +"VAEKEYAC= :VAEKEYAC,"
                    +"VAESTLAND= :VAESTLAND,"
                    +"VAESTREGBZ= :VAESTREGBZ,"
                    +"VAESTKREIS= :VAESTKREIS,"
                    +"VAESTORT= :VAESTORT,"
                    +"VAECOUNTY= :VAECOUNTY,"
                    +"VAEKONZMIT= :VAEKONZMIT,"
                    +"VAEABSSCHL= :VAEABSSCHL,"
                    +"VAEDISTRWEG= :VAEDISTRWEG,"
                    +"VAEWERBSL1= :VAEWERBSL1,"
                    +"VAEWERBSL2= :VAEWERBSL2,"
                    +"VAEWERBSL3= :VAEWERBSL3,"
                    +"VAEWERBSL4= :VAEWERBSL4,"
                    +"VAEWERBSL5= :VAEWERBSL5,"
                    +"VAEKOLLSEG1= :VAEKOLLSEG1,"
                    +"VAEKOLLSEG2= :VAEKOLLSEG2,"
                    +"VAEKOLLSEG3= :VAEKOLLSEG3,"
                    +"VAEKOLLSEG4= :VAEKOLLSEG4,"
                    +"VAEKOLLSEG5= :VAEKOLLSEG5,"
                    +"VAEFEATURE1= :VAEFEATURE1,"
                    +"VAEFEATURE2= :VAEFEATURE2,"
                    +"VAEFEATURE3= :VAEFEATURE3,"
                    +"VAEFEATURE4= :VAEFEATURE4,"
                    +"VAEFEATURE5= :VAEFEATURE5,"
                    +"VAEEINSATZG= :VAEEINSATZG,"
                    +"VAEVERWEND= :VAEVERWEND,"
                    +"VAEABZKZ= :VAEABZKZ,"
                    +"VAEERLKZ= :VAEERLKZ,"
                    +"VAESGRD= :VAESGRD,"
                    +"VAEVTYP= :VAEVTYP,"
                    +"VAEFILLER2= :VAEFILLER2,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("VAEMANDANT", OracleType.NVarChar).Value = dwData["VAEMANDANT"].ToString(); 
          or1.Parameters.Add("VAEAUFTYP", OracleType.NVarChar).Value = dwData["VAEAUFTYP"].ToString(); 
          or1.Parameters.Add("VAEAUFKRS", OracleType.NVarChar).Value = dwData["VAEAUFKRS"].ToString(); 
          or1.Parameters.Add("VAEAUFLFD", OracleType.NVarChar).Value = dwData["VAEAUFLFD"].ToString(); 
          or1.Parameters.Add("VAEAUFPOS", OracleType.NVarChar).Value = dwData["VAEAUFPOS"].ToString(); 
          or1.Parameters.Add("VAEAENDST", OracleType.NVarChar).Value = dwData["VAEAENDST"].ToString(); 
          or1.Parameters.Add("VAEAUFART", OracleType.NVarChar).Value = dwData["VAEAUFART"].ToString(); 
          or1.Parameters.Add("VAEAEDAT", OracleType.NVarChar).Value = dwData["VAEAEDAT"].ToString(); 
          or1.Parameters.Add("VAEERSTAKZ", OracleType.NVarChar).Value = dwData["VAEERSTAKZ"].ToString(); 
          or1.Parameters.Add("VAEORDER", OracleType.NVarChar).Value = dwData["VAEORDER"].ToString(); 
          or1.Parameters.Add("VAEPRGRP", OracleType.NVarChar).Value = dwData["VAEPRGRP"].ToString(); 
          or1.Parameters.Add("VAEPROJNR", OracleType.NVarChar).Value = dwData["VAEPROJNR"].ToString(); 
          or1.Parameters.Add("VAEVKZ", OracleType.NVarChar).Value = dwData["VAEVKZ"].ToString(); 
          or1.Parameters.Add("VAEAENDDAT", OracleType.NVarChar).Value = dwData["VAEAENDDAT"].ToString(); 
          or1.Parameters.Add("VAEPOSTYP", OracleType.NVarChar).Value = dwData["VAEPOSTYP"].ToString(); 
          or1.Parameters.Add("VAEVB", OracleType.NVarChar).Value = dwData["VAEVB"].ToString(); 
          or1.Parameters.Add("VAEVG", OracleType.NVarChar).Value = dwData["VAEVG"].ToString(); 
          or1.Parameters.Add("VAEVERTNR1", OracleType.NVarChar).Value = dwData["VAEVERTNR1"].ToString(); 
          or1.Parameters.Add("VAEVERTNR2", OracleType.NVarChar).Value = dwData["VAEVERTNR2"].ToString(); 
          or1.Parameters.Add("VAEVERTNR3", OracleType.NVarChar).Value = dwData["VAEVERTNR3"].ToString(); 
          or1.Parameters.Add("VAEVERTNR4", OracleType.NVarChar).Value = dwData["VAEVERTNR4"].ToString(); 
          or1.Parameters.Add("VAELAND", OracleType.NVarChar).Value = dwData["VAELAND"].ToString(); 
          or1.Parameters.Add("VAEKZINLEXP", OracleType.NVarChar).Value = dwData["VAEKZINLEXP"].ToString(); 
          or1.Parameters.Add("VAEPLZ", OracleType.NVarChar).Value = dwData["VAEPLZ"].ToString(); 
          or1.Parameters.Add("VAEGEBIET", OracleType.NVarChar).Value = dwData["VAEGEBIET"].ToString(); 
          or1.Parameters.Add("VAEKUNDNR", OracleType.NVarChar).Value = dwData["VAEKUNDNR"].ToString(); 
          or1.Parameters.Add("VAEVERBNR", OracleType.NVarChar).Value = dwData["VAEVERBNR"].ToString(); 
          or1.Parameters.Add("VAEZENTRR", OracleType.NVarChar).Value = dwData["VAEZENTRR"].ToString(); 
          or1.Parameters.Add("VAEZENTR", OracleType.NVarChar).Value = dwData["VAEZENTR"].ToString(); 
          or1.Parameters.Add("VAEABNGRP", OracleType.NVarChar).Value = dwData["VAEABNGRP"].ToString(); 
          or1.Parameters.Add("VAEBRANCHE", OracleType.NVarChar).Value = dwData["VAEBRANCHE"].ToString(); 
          or1.Parameters.Add("VAEABCKL", OracleType.NVarChar).Value = dwData["VAEABCKL"].ToString(); 
          or1.Parameters.Add("VAEKUNDNRST", OracleType.NVarChar).Value = dwData["VAEKUNDNRST"].ToString(); 
          or1.Parameters.Add("VAEABNGRPST", OracleType.NVarChar).Value = dwData["VAEABNGRPST"].ToString(); 
          or1.Parameters.Add("VAEBUSIMODE", OracleType.NVarChar).Value = dwData["VAEBUSIMODE"].ToString(); 
          or1.Parameters.Add("VAEPRDGR", OracleType.NVarChar).Value = dwData["VAEPRDGR"].ToString(); 
          or1.Parameters.Add("VAEARTGRP", OracleType.NVarChar).Value = dwData["VAEARTGRP"].ToString(); 
          or1.Parameters.Add("VAEZIELGR", OracleType.NVarChar).Value = dwData["VAEZIELGR"].ToString(); 
          or1.Parameters.Add("VAEPVGRP", OracleType.NVarChar).Value = dwData["VAEPVGRP"].ToString(); 
          or1.Parameters.Add("VAEOBERKOLL", OracleType.NVarChar).Value = dwData["VAEOBERKOLL"].ToString(); 
          or1.Parameters.Add("VAEKOLL", OracleType.NVarChar).Value = dwData["VAEKOLL"].ToString(); 
          or1.Parameters.Add("VAEVART", OracleType.NVarChar).Value = dwData["VAEVART"].ToString(); 
          or1.Parameters.Add("VAEVFARBE", OracleType.NVarChar).Value = dwData["VAEVFARBE"].ToString(); 
          or1.Parameters.Add("VAEVZENSUR", OracleType.NVarChar).Value = dwData["VAEVZENSUR"].ToString(); 
          or1.Parameters.Add("VAEVAUFMART", OracleType.NVarChar).Value = dwData["VAEVAUFMART"].ToString(); 
          or1.Parameters.Add("VAEVVERPART", OracleType.NVarChar).Value = dwData["VAEVVERPART"].ToString(); 
          or1.Parameters.Add("VAEVGROE", OracleType.NVarChar).Value = dwData["VAEVGROE"].ToString(); 
          or1.Parameters.Add("VAEVZOLLTNR", OracleType.NVarChar).Value = dwData["VAEVZOLLTNR"].ToString(); 
          or1.Parameters.Add("VAESTATWNR", OracleType.NVarChar).Value = dwData["VAESTATWNR"].ToString(); 
          or1.Parameters.Add("VAEDKUNDNR", OracleType.NVarChar).Value = dwData["VAEDKUNDNR"].ToString(); 
          or1.Parameters.Add("VAEDWERK", OracleType.NVarChar).Value = dwData["VAEDWERK"].ToString(); 
          or1.Parameters.Add("VAEDABT", OracleType.NVarChar).Value = dwData["VAEDABT"].ToString(); 
          or1.Parameters.Add("VAEDART", OracleType.NVarChar).Value = dwData["VAEDART"].ToString(); 
          or1.Parameters.Add("VAEDVAR", OracleType.NVarChar).Value = dwData["VAEDVAR"].ToString(); 
          or1.Parameters.Add("VAEZUSAETZE", OracleType.NVarChar).Value = dwData["VAEZUSAETZE"].ToString(); 
          or1.Parameters.Add("VAEPHK1", OracleType.NVarChar).Value = dwData["VAEPHK1"].ToString(); 
          or1.Parameters.Add("VAEPHK2", OracleType.NVarChar).Value = dwData["VAEPHK2"].ToString(); 
          or1.Parameters.Add("VAEPHK3", OracleType.NVarChar).Value = dwData["VAEPHK3"].ToString(); 
          or1.Parameters.Add("VAEPHK4", OracleType.NVarChar).Value = dwData["VAEPHK4"].ToString(); 
          or1.Parameters.Add("VAEPHK5", OracleType.NVarChar).Value = dwData["VAEPHK5"].ToString(); 
          or1.Parameters.Add("VAEPHK6", OracleType.NVarChar).Value = dwData["VAEPHK6"].ToString(); 
          or1.Parameters.Add("VAEPLART", OracleType.NVarChar).Value = dwData["VAEPLART"].ToString(); 
          or1.Parameters.Add("VAERFDDIS", OracleType.NVarChar).Value = dwData["VAERFDDIS"].ToString(); 
          or1.Parameters.Add("VAEUMSATZAUFTR", OracleType.NVarChar).Value = dwData["VAEUMSATZAUFTR"].ToString(); 
          or1.Parameters.Add("VAEMENGE1", OracleType.NVarChar).Value = dwData["VAEMENGE1"].ToString(); 
          or1.Parameters.Add("VAEMENGE2", OracleType.NVarChar).Value = dwData["VAEMENGE2"].ToString(); 
          or1.Parameters.Add("VAEMENGE3", OracleType.NVarChar).Value = dwData["VAEMENGE3"].ToString(); 
          or1.Parameters.Add("VAEMENGE4", OracleType.NVarChar).Value = dwData["VAEMENGE4"].ToString(); 
          or1.Parameters.Add("VAEZUGET1", OracleType.NVarChar).Value = dwData["VAEZUGET1"].ToString(); 
          or1.Parameters.Add("VAEZUGET2", OracleType.NVarChar).Value = dwData["VAEZUGET2"].ToString(); 
          or1.Parameters.Add("VAEZUGET3", OracleType.NVarChar).Value = dwData["VAEZUGET3"].ToString(); 
          or1.Parameters.Add("VAEZUGET4", OracleType.NVarChar).Value = dwData["VAEZUGET4"].ToString(); 
          or1.Parameters.Add("VAERESERV1", OracleType.NVarChar).Value = dwData["VAERESERV1"].ToString(); 
          or1.Parameters.Add("VAERESERV2", OracleType.NVarChar).Value = dwData["VAERESERV2"].ToString(); 
          or1.Parameters.Add("VAERESERV3", OracleType.NVarChar).Value = dwData["VAERESERV3"].ToString(); 
          or1.Parameters.Add("VAERESERV4", OracleType.NVarChar).Value = dwData["VAERESERV4"].ToString(); 
          or1.Parameters.Add("VAERABWERT", OracleType.NVarChar).Value = dwData["VAERABWERT"].ToString(); 
          or1.Parameters.Add("VAEZUABWERT", OracleType.NVarChar).Value = dwData["VAEZUABWERT"].ToString(); 
          or1.Parameters.Add("VAETRANSCO", OracleType.NVarChar).Value = dwData["VAETRANSCO"].ToString(); 
          or1.Parameters.Add("VAEMWST", OracleType.NVarChar).Value = dwData["VAEMWST"].ToString(); 
          or1.Parameters.Add("VAEWAEHRSL", OracleType.NVarChar).Value = dwData["VAEWAEHRSL"].ToString(); 
          or1.Parameters.Add("VAEKURS", OracleType.NVarChar).Value = dwData["VAEKURS"].ToString(); 
          or1.Parameters.Add("VAEBETRAG", OracleType.NVarChar).Value = dwData["VAEBETRAG"].ToString(); 
          or1.Parameters.Add("VAEHWAEHRSL", OracleType.NVarChar).Value = dwData["VAEHWAEHRSL"].ToString(); 
          or1.Parameters.Add("VAEHEUROKURS", OracleType.NVarChar).Value = dwData["VAEHEUROKURS"].ToString(); 
          or1.Parameters.Add("VAEHEUROKURSVK", OracleType.NVarChar).Value = dwData["VAEHEUROKURSVK"].ToString(); 
          or1.Parameters.Add("VAEFEUROKURS", OracleType.NVarChar).Value = dwData["VAEFEUROKURS"].ToString(); 
          or1.Parameters.Add("VAEFEUROKURSVK", OracleType.NVarChar).Value = dwData["VAEFEUROKURSVK"].ToString(); 
          or1.Parameters.Add("VAEAUFTRMENGE", OracleType.NVarChar).Value = dwData["VAEAUFTRMENGE"].ToString(); 
          or1.Parameters.Add("VAEMEEH", OracleType.NVarChar).Value = dwData["VAEMEEH"].ToString(); 
          or1.Parameters.Add("VAEMEEHGRP", OracleType.NVarChar).Value = dwData["VAEMEEHGRP"].ToString(); 
          or1.Parameters.Add("VAEMEEHFKT", OracleType.NVarChar).Value = dwData["VAEMEEHFKT"].ToString(); 
          or1.Parameters.Add("VAEUMSATZPRL", OracleType.NVarChar).Value = dwData["VAEUMSATZPRL"].ToString(); 
          or1.Parameters.Add("VAESACHB", OracleType.NVarChar).Value = dwData["VAESACHB"].ToString(); 
          or1.Parameters.Add("VAEDSACHB", OracleType.NVarChar).Value = dwData["VAEDSACHB"].ToString(); 
          or1.Parameters.Add("VAEKOAUFKRS", OracleType.NVarChar).Value = dwData["VAEKOAUFKRS"].ToString(); 
          or1.Parameters.Add("VAEKOAUFLFD", OracleType.NVarChar).Value = dwData["VAEKOAUFLFD"].ToString(); 
          or1.Parameters.Add("VAEKOAUFPOS", OracleType.NVarChar).Value = dwData["VAEKOAUFPOS"].ToString(); 
          or1.Parameters.Add("VAEKOAUFART", OracleType.NVarChar).Value = dwData["VAEKOAUFART"].ToString(); 
          or1.Parameters.Add("VAEKOAUFKRS1", OracleType.NVarChar).Value = dwData["VAEKOAUFKRS1"].ToString(); 
          or1.Parameters.Add("VAEKOAUFLFD1", OracleType.NVarChar).Value = dwData["VAEKOAUFLFD1"].ToString(); 
          or1.Parameters.Add("VAEKOAUFPOS1", OracleType.NVarChar).Value = dwData["VAEKOAUFPOS1"].ToString(); 
          or1.Parameters.Add("VAEKOAUFART1", OracleType.NVarChar).Value = dwData["VAEKOAUFART1"].ToString(); 
          or1.Parameters.Add("VAEKUNDNRKO", OracleType.NVarChar).Value = dwData["VAEKUNDNRKO"].ToString(); 
          or1.Parameters.Add("VAECOUPON", OracleType.NVarChar).Value = dwData["VAECOUPON"].ToString(); 
          or1.Parameters.Add("VAEPART", OracleType.NVarChar).Value = dwData["VAEPART"].ToString(); 
          or1.Parameters.Add("VAEPRODST", OracleType.NVarChar).Value = dwData["VAEPRODST"].ToString(); 
          or1.Parameters.Add("VAEARTST", OracleType.NVarChar).Value = dwData["VAEARTST"].ToString(); 
          or1.Parameters.Add("VAEPVAR", OracleType.NVarChar).Value = dwData["VAEPVAR"].ToString(); 
          or1.Parameters.Add("VAELIEFEING", OracleType.NVarChar).Value = dwData["VAELIEFEING"].ToString(); 
          or1.Parameters.Add("VAELITERM", OracleType.NVarChar).Value = dwData["VAELITERM"].ToString(); 
          or1.Parameters.Add("VAENEUDAT", OracleType.NVarChar).Value = dwData["VAENEUDAT"].ToString(); 
          or1.Parameters.Add("VAEMWSTAB", OracleType.NVarChar).Value = dwData["VAEMWSTAB"].ToString(); 
          or1.Parameters.Add("VAEZUSTAND", OracleType.NVarChar).Value = dwData["VAEZUSTAND"].ToString(); 
          or1.Parameters.Add("VAEPRMTR", OracleType.NVarChar).Value = dwData["VAEPRMTR"].ToString(); 
          or1.Parameters.Add("VAEKKOLL", OracleType.NVarChar).Value = dwData["VAEKKOLL"].ToString(); 
          or1.Parameters.Add("VAEMKOLL", OracleType.NVarChar).Value = dwData["VAEMKOLL"].ToString(); 
          or1.Parameters.Add("VAENOCOUNT", OracleType.NVarChar).Value = dwData["VAENOCOUNT"].ToString(); 
          or1.Parameters.Add("VAEFARBGRP", OracleType.NVarChar).Value = dwData["VAEFARBGRP"].ToString(); 
          or1.Parameters.Add("VAEVMVB", OracleType.NVarChar).Value = dwData["VAEVMVB"].ToString(); 
          or1.Parameters.Add("VAEVMVG", OracleType.NVarChar).Value = dwData["VAEVMVG"].ToString(); 
          or1.Parameters.Add("VAEKEYAC", OracleType.NVarChar).Value = dwData["VAEKEYAC"].ToString(); 
          or1.Parameters.Add("VAESTLAND", OracleType.NVarChar).Value = dwData["VAESTLAND"].ToString(); 
          or1.Parameters.Add("VAESTREGBZ", OracleType.NVarChar).Value = dwData["VAESTREGBZ"].ToString(); 
          or1.Parameters.Add("VAESTKREIS", OracleType.NVarChar).Value = dwData["VAESTKREIS"].ToString(); 
          or1.Parameters.Add("VAESTORT", OracleType.NVarChar).Value = dwData["VAESTORT"].ToString(); 
          or1.Parameters.Add("VAECOUNTY", OracleType.NVarChar).Value = dwData["VAECOUNTY"].ToString(); 
          or1.Parameters.Add("VAEKONZMIT", OracleType.NVarChar).Value = dwData["VAEKONZMIT"].ToString(); 
          or1.Parameters.Add("VAEABSSCHL", OracleType.NVarChar).Value = dwData["VAEABSSCHL"].ToString(); 
          or1.Parameters.Add("VAEDISTRWEG", OracleType.NVarChar).Value = dwData["VAEDISTRWEG"].ToString(); 
          or1.Parameters.Add("VAEWERBSL1", OracleType.NVarChar).Value = dwData["VAEWERBSL1"].ToString(); 
          or1.Parameters.Add("VAEWERBSL2", OracleType.NVarChar).Value = dwData["VAEWERBSL2"].ToString(); 
          or1.Parameters.Add("VAEWERBSL3", OracleType.NVarChar).Value = dwData["VAEWERBSL3"].ToString(); 
          or1.Parameters.Add("VAEWERBSL4", OracleType.NVarChar).Value = dwData["VAEWERBSL4"].ToString(); 
          or1.Parameters.Add("VAEWERBSL5", OracleType.NVarChar).Value = dwData["VAEWERBSL5"].ToString(); 
          or1.Parameters.Add("VAEKOLLSEG1", OracleType.NVarChar).Value = dwData["VAEKOLLSEG1"].ToString(); 
          or1.Parameters.Add("VAEKOLLSEG2", OracleType.NVarChar).Value = dwData["VAEKOLLSEG2"].ToString(); 
          or1.Parameters.Add("VAEKOLLSEG3", OracleType.NVarChar).Value = dwData["VAEKOLLSEG3"].ToString(); 
          or1.Parameters.Add("VAEKOLLSEG4", OracleType.NVarChar).Value = dwData["VAEKOLLSEG4"].ToString(); 
          or1.Parameters.Add("VAEKOLLSEG5", OracleType.NVarChar).Value = dwData["VAEKOLLSEG5"].ToString(); 
          or1.Parameters.Add("VAEFEATURE1", OracleType.NVarChar).Value = dwData["VAEFEATURE1"].ToString(); 
          or1.Parameters.Add("VAEFEATURE2", OracleType.NVarChar).Value = dwData["VAEFEATURE2"].ToString(); 
          or1.Parameters.Add("VAEFEATURE3", OracleType.NVarChar).Value = dwData["VAEFEATURE3"].ToString(); 
          or1.Parameters.Add("VAEFEATURE4", OracleType.NVarChar).Value = dwData["VAEFEATURE4"].ToString(); 
          or1.Parameters.Add("VAEFEATURE5", OracleType.NVarChar).Value = dwData["VAEFEATURE5"].ToString(); 
          or1.Parameters.Add("VAEEINSATZG", OracleType.NVarChar).Value = dwData["VAEEINSATZG"].ToString(); 
          or1.Parameters.Add("VAEVERWEND", OracleType.NVarChar).Value = dwData["VAEVERWEND"].ToString(); 
          or1.Parameters.Add("VAEABZKZ", OracleType.NVarChar).Value = dwData["VAEABZKZ"].ToString(); 
          or1.Parameters.Add("VAEERLKZ", OracleType.NVarChar).Value = dwData["VAEERLKZ"].ToString(); 
          or1.Parameters.Add("VAESGRD", OracleType.NVarChar).Value = dwData["VAESGRD"].ToString(); 
          or1.Parameters.Add("VAEVTYP", OracleType.NVarChar).Value = dwData["VAEVTYP"].ToString(); 
          or1.Parameters.Add("VAEFILLER2", OracleType.NVarChar).Value = dwData["VAEFILLER2"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
